package com.zznj.xzjc.adapter;

import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zznj.xzjc.R;
import com.zznj.xzjc.net.entity.AreaBean;
import com.zznj.xzjc.net.entity.LcjdBean;
import com.zznj.xzjc.utils.StringUtils;
import com.zznj.xzjc.utils.TimeUtils;

import java.util.HashMap;
import java.util.List;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/7
 */
public class LcjdAdapter extends BaseQuickAdapter<LcjdBean, BaseViewHolder> {

    public LcjdAdapter(int layoutResId, @Nullable List<LcjdBean> data) {
        super(layoutResId, data);
    }

    private HashMap<Integer,String> hjMap = new HashMap<Integer, String>(){{
        put(0,"行政受理");
        put(1,"行政立案");
        put(3,"行政不立案");
        put(2,"行政处罚");
        put(38,"行政复议");
        put(4,"行政撤案");
        put(39,"催告");
        put(40,"行政执行");
        put(42,"申请强制执行");
        put(41,"撤回强制执行");
        put(51,"结案");
        put(53,"法院受理");
        put(52,"法院不予受理");
        put(43,"法院立案");
        put(44,"法院不予立案");
        put(56,"裁定准予撤回执行");
        put(45,"裁定准予执行");
        put(46,"裁定不予执行");
        put(47,"终结本次执行");
        put(54,"终结执行");
        put(55,"执行完毕");
    }};

    @Override
    protected void convert(BaseViewHolder helper, LcjdBean item) {
        helper.setText(R.id.lcjdTitle,item.getCaseName())
                .setText(R.id.lcjdLrdw,"录入单位："+ (StringUtils.isEmpty(item.getInputUnitName())?item.getCreateOrgName():item.getInputUnitName()))
                .setText(R.id.lcjdBlsj, "办理时间："+TimeUtils.getTime(item.getLatestPocessTime(),"yyyy-MM-dd HH:mm:ss"))
                .setText(R.id.lcjdXzsl,"案件状态："+item.getCaseStateName());
        if(item.getWarnMap() == null || item.getWarnMap().size() == 0){
            helper.getView(R.id.lcjdJinGaoImg).setVisibility(View.GONE);
        }
    }
}
